import java.util.Iterator;


public class FlexiEmployee extends Employee{
	private int standardDay;
	private int flexiTime;
	
	public void setStandardDay(int value)
	{
		this.standardDay = value;
	}
	
	public int getStandardDay()
	{
		return this.standardDay;
	}
	
	public void setFlexiTime(int value)
	{
		this.flexiTime = value;
	}
	
	public int getFlexiTime()
	{
		return this.flexiTime;
	}
	 
	public void processTimeSheet()
	{
		Iterator<Interval> iterator = timeSheet.iterator();
		int count = 0;
		int daysWorked = 0;
		while (iterator.hasNext()) {
			Interval interval = iterator.next();
			daysWorked++;
			count+= interval.getDuration();
		}
		minutesWorked = count;
		flexiTime = minutesWorked - daysWorked*standardDay;
	}
}
